<?php

/**
 * user form base class.
 *
 * @method user getObject() Returns the current form's model object
 *
 * @package    worldmap
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
class searchForm extends BaseForm
{
  public function setup()
  {
    parent::setup();

    $this->widgetSchema   ['text'] = new sfWidgetFormInputText();
    $this->validatorSchema['text'] = new sfValidatorString(array('required' => false));

    $types = array('user' => 'DJs', 'event' => 'events', 'store' => 'stores');
    $this->widgetSchema   ['types'] = new sfWidgetFormChoice(array('multiple' => true, 'choices' => $types));
    $this->validatorSchema['types'] = new sfValidatorChoice(array('multiple' => true, 'choices' => $types, 'required' => false));

    $this->widgetSchema   ['controller_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'controller'));
    $this->validatorSchema['controller_list'] = new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'controller', 'required' => false));

    $this->widgetSchema   ['manufacturer_list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'manufacturer'));
    $this->validatorSchema['manufacturer_list'] = new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'manufacturer', 'required' => false));

    $this->widgetSchema   ['startdate'] = new sfWidgetFormDate();
    $this->validatorSchema['startdate'] = new sfValidatorDate(array('date_format' => 'Y-m-d', 'required' => false));

    $this->widgetSchema   ['enddate'] = new sfWidgetFormDate();
    $this->validatorSchema['enddate'] = new sfValidatorDate(array('date_format' => 'Y-m-d', 'required' => false));

    $this->widgetSchema->setNameFormat('filter[%s]');

    $this->disableCSRFProtection();
  }
}
